/*
 * jquery.inputmask.extensions.js
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2014 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 * Version: 3.1.23
 */
!function (a) {
    "function" == typeof define && define.amd ? define(["jquery", "./jquery.inputmask"], a) : a(jQuery)
}(function (a) {
    return a.extend(a.inputmask.defaults.definitions, {
        A: {
            validator: "[A-Za-zА-яЁёÀ-ÿµ]",
            cardinality: 1,
            casing: "upper"
        }, "#": {validator: "[0-9A-Za-zА-яЁёÀ-ÿµ]", cardinality: 1, casing: "upper"}
    }), a.extend(a.inputmask.defaults.aliases, {
        url: {
            mask: "ir",
            placeholder: "",
            separator: "",
            defaultPrefix: "http://",
            regex: {
                urlpre1: new RegExp("[fh]"),
                urlpre2: new RegExp("(ft|ht)"),
                urlpre3: new RegExp("(ftp|htt)"),
                urlpre4: new RegExp("(ftp:|http|ftps)"),
                urlpre5: new RegExp("(ftp:/|ftps:|http:|https)"),
                urlpre6: new RegExp("(ftp://|ftps:/|http:/|https:)"),
                urlpre7: new RegExp("(ftp://|ftps://|http://|https:/)"),
                urlpre8: new RegExp("(ftp://|ftps://|http://|https://)")
            },
            definitions: {
                i: {
                    validator: function () {
                        return !0
                    }, cardinality: 8, prevalidator: function () {
                        for (var a = [], b = 8, c = 0; b > c; c++)a[c] = function () {
                            var a = c;
                            return {
                                validator: function (b, c, d, e, f) {
                                    if (f.regex["urlpre" + (a + 1)]) {
                                        var g, h = b;
                                        a + 1 - b.length > 0 && (h = c.buffer.join("").substring(0, a + 1 - b.length) + "" + h);
                                        var i = f.regex["urlpre" + (a + 1)].test(h);
                                        if (!e && !i) {
                                            for (d -= a, g = 0; g < f.defaultPrefix.length; g++)c.buffer[d] = f.defaultPrefix[g], d++;
                                            for (g = 0; g < h.length - 1; g++)c.buffer[d] = h[g], d++;
                                            return {pos: d}
                                        }
                                        return i
                                    }
                                    return !1
                                }, cardinality: a
                            }
                        }();
                        return a
                    }()
                }, r: {validator: ".", cardinality: 50}
            },
            insertMode: !1,
            autoUnmask: !1
        },
        ip: {
            mask: "i[i[i]].i[i[i]].i[i[i]].i[i[i]]", definitions: {
                i: {
                    validator: function (a, b, c) {
                        return c - 1 > -1 && "." != b.buffer[c - 1] ? (a = b.buffer[c - 1] + a, a = c - 2 > -1 && "." != b.buffer[c - 2] ? b.buffer[c - 2] + a : "0" + a) : a = "00" + a, new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(a)
                    }, cardinality: 1
                }
            }
        },
        email: {
            mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}[.*{2,20}][.*{2,6}][.*{1,2}]",
            greedy: !1,
            onBeforePaste: function (a) {
                return a = a.toLowerCase(), a.replace("mailto:", "")
            },
            definitions: {"*": {validator: "[0-9A-Za-z!#$%&'*+/=?^_`{|}~-]", cardinality: 1, casing: "lower"}}
        }
    }), a.fn.inputmask
});